package cn.wusifx.zabbix.request.builder.user;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.RequestBuilder;

import java.util.HashMap;
import java.util.Map;

public class UserLoginRequestBuilder extends RequestBuilder<Map<String,Object>> {
    private String userName;
    private String password;

    public UserLoginRequestBuilder() {
        super("user.login");
        baseRequest.setParams(new HashMap<>());
    }

    public UserLoginRequestBuilder(Long id) {
        super("user.login", id);
        baseRequest.setParams(new HashMap<>());
    }

    public UserLoginRequestBuilder setUserName(String userName) {
        this.userName = userName;
        return this;
    }

    public UserLoginRequestBuilder setPassword(String password) {
        this.password = password;
        return this;
    }

    public String getUserName() {
        return userName;
    }

    public String getPassword() {
        return password;
    }
    @Override
    public BaseRequest builder() {
        baseRequest.getParams().put("user", userName);
        baseRequest.getParams().put("password", password);
        return baseRequest;
    }
}